export const billData = {
  pay: [
    {
      type: 'foods',
      name: '餐饮',
      list: [
        { type: 'food', name: '餐费' },
        { type: 'drinks', name: '酒水饮料' },
        { type: 'desserts', name: '甜品零食' },
      ]
    },
    {
      type: 'transport',
      name: '交通',
      list: [
        { type: 'transport', name: '交通费' },
        { type: 'bus', name: '公交地铁' },
        { type: 'taxi', name: '出租车' },
        { type: 'train', name: '火车高铁' },
        { type: 'plane', name: '飞机' }
      ]
    },
    {
      type: 'shopping',
      name: '购物',
      list: [
        { type: 'shopping', name: '购物'},
        { type: 'clothes', name: '衣服裤子' },
        { type: 'shoes', name: '鞋帽包包' },
        { type: 'electronics', name: '数码电器' },
        { type: 'cosmetics', name: '美妆护肤' }
      ]
    },
    {
      type: 'entertainment',
      name: '娱乐',
      list: [
        { type: 'entertainment', name: '电影' },
        { type: 'movie', name: '电影' },
        { type: 'game', name: '游戏' },
        { type: 'sports', name: '运动健身' },
        { type: 'travel', name: '旅游度假' }
      ]
    },
    {
      type: 'health',
      name: '医疗健康',
      list: [
        { type: 'health', name: '医疗药品' },
        { type: 'medical', name: '医疗药品' },
        { type: 'insurance', name: '保险' },
        { type: 'checkup', name: '体检' }
      ]
    },
    {
      type: 'education',
      name: '教育',
      list: [
        { type: 'education', name: '学费' },
        { type: 'tuition', name: '学费' },
        { type: 'book', name: '图书教材' },
        { type: 'training', name: '培训课程' }
      ]
    }
  ],
  income: [
    {
      type: 'salary',
      name: '工资收入',
      list: [
        { type: 'salary', name: '工资' },
        { type: 'bonus', name: '奖金' },
        { type: 'overtime', name: '加班费' }
      ]
    }
  ]
};

export const billTypeToName=Object.keys(billData).reduce((prev, key) => {
  billData[key].forEach(bill=>{
    bill.list.forEach(item=>{
      prev[item.type] = item.name
    })
  })
  return prev
}, {})